<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        [v-cloak]{
            display: none;
        }
    </style>
</head>

<body>
    <div id="app">
        <p id="p01">{{msg}}</p>
        <p id="p02" >{{msg}}</p>
        <p id="p03" >{{msg}}</p>
        <p>{{str}}</p>
    </div>
    <input type="button" value="修改msg" onclick="changeMsg()" >
</body>

</html>
<script src="./js/myVue2.js"></script>
<script>


    let vm = new Vue({
        el: "#app",
        data: {
            msg:"hello",
            str:"hi"
        },
        methods:{
            fn(){
                this.msg+="1"
            }
        }
    });

    function changeMsg(){
        vm.msg +="1";
        console.log("vm.msg",vm.msg);
    }

</script>